snippet #!
	#!/usr/bin/env ruby
	# encoding: utf-8
	${1}
# 字符串、代码块
snippet q 相当于单引号字符串
	%q[${1}]${2}
snippet Q 相当于双引号字符串
	%Q[${1}]${2}
snippet ws 字符串数组
	%w{${1}}${2}
snippet str 多行字符串
	<<${1:EOF}
	${2}
	$1
	${3}
snippet =b 代码块
	=begin
	${1}
	=end
	${2}
# 正则表达式
snippet =
	=~ 
snippet !
	!~ 
snippet /
	/${1}/${2}
snippet R
	%R{${1}}${2}
# 包含指令
snippet in
	include 
snippet rq
	require "${1}"${2}
snippet lo
	load "${1}"${2}
# 模块
snippet mo
	module ${1:m_name}

		${2}
	end
# 类、方法
snippet cl
	class ${1:cl_name}

		${2}
	end
snippet d 不带参数的
	def ${1:f_name}
		${2}
	end
snippet d. 带参数的
	def ${1:f_name}(${2})
		${3}
	end
snippet di 构造方法（不带参数）
	def initialize
		${1}
	end
snippet di. 构造方法（带参数）
	def initialize(${1})
		${2}
	end
snippet at_w
	attr_writer :
snippet at_r
	attr_reader :
snippet at_a
	attr_accessor :
snippet la
	lambda
# 流程控制
snippet if
	if ${1}
		${2}
	end
snippet elif
	elsif ${1}
		${2}
snippet el
	else
		${1}
snippet th
	then
		${1}
snippet ? 三元运算符
	${1:condition} ? ${2} : ${3}
# 循环语句
snippet for
	for ${1} in ${2}
		${3}
	end
snippet wh
	while ${1}
		${2}
	end
snippet ut
	until ${1}
		${2}
	end
snippet loo
	loop do
		${1}
	end
snippet ul
	unless ${1}
snippet cs
	case ${1}
		${2}
	end
snippet w
	when ${1}
snippet do 无参数的
	do
		${1}
	end
snippet do. 有参数的
	do ${1}
		${2}
	end
# 迭代器
snippet e
	each do |${1}|
		${2}
	end
snippet e_i
	each_index do |${1}|
		${2}
	end
snippet e_b
	each_byte do |${1}|
		${2}
	end
snippet e_c
	each_char do |${1}|
		${2}
	end
snippet e_l
	each_line do |${1}|
		${2}
	end
snippet ewi
	each_with_index do |${1}|
		${2}
	end
snippet tm
	times do
		${1}
	end
# 异常处理
snippet be
	begin
		${1}
	end
snippet rs
	raise ${1}
snippet res
	rescue 
snippet ens
	ensure
# 测试方法
snippet dfd 是否已定义
	defined?
snippet rsp 能否做出响应
	respond_to?
snippet isa 是否为特定的类（包含超类）
	is_a?
snippet kdo is_a?的别名
	kind_of?
# 常用方法
snippet cap
	capitalize${1}
# 单个关键字
snippet pu
	public :
snippet pu. 换行版
	public
	${1}
snippet po
	protected :
snippet po. 换行版
	protected
	${1}
snippet pr
	private :
snippet pr. 换行版
	private
	${1}
snippet re
	return ${1}
snippet rev
	reverse
snippet br
	break
snippet ne
	next
snippet rd
	redo
snippet rt
	retry
snippet yi
	yield${1}
snippet sp
	super
snippet al 别名
	alias ${1}
snippet s
	self
snippet p
	puts ${1}
snippet pi
	print ${1}
snippet |
	|${1}| ${2}
snippet .
	=> ${1}
# Rails相关
snippet n_t_c 价格格式化
	number_to_currency(${1})${2}
snippet ha_m 模型关联
	has_many ${1}
snippet be_t 模型依赖
	belongs_to ${1}
snippet de_s 默认排列
	default_scope ${1}
snippet red_t
	redirect_to ${1}
snippet res_t
	respond_to ${1}
snippet red
	render ${1}
snippet val
	validates ${1}
# 测试
snippet test 测试方法
	test "${1}" do
		${2}
	end
snippet as 断言
	assert ${1}
snippet as_e
	assert_equal ${1}
snippet as_m
	assert_match ${1}
snippet as_r
	assert_response ${1}
snippet as_s
	assert_select ${1}
snippet as_t
	assert_template ${1}
snippet as_d
	assert_difference ${1}
snippet as_r_t
	assert_redirected_to ${1}
snippet p_v_r
	post_via_redirect ${1}
